<?php
$method = $_GET['method'];
if($method == 'getMoreArticles') {
	while( have_posts() ) : the_post();?>
	<div class="xq-content block">
        <?php if ( has_post_thumbnail() ) : /*check for thumbnail existing*/ ?>
			  <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
		<?php { the_post_thumbnail(get_the_ID(), 'small', true);  } ?>
			</a>
			 <?php else :?>
   			 <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo site_url();?>/wp-content/themes/xique/images/thumbnail.png"></a>
          <?php endif;?>
		<div>
            <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title_cut() ?></a></h2>
            <div><span>From</span><span><?php the_author(); ?></span></div>
        </div>
    </div>
    <?php endwhile;?>
<?php } else {
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
               
     <script src="http://cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
     <script src="/wp-content/themes/xique-mobile/js/index.js"></script>
     <script src="/wp-content/themes/xique-mobile/js/unslider.js"></script>
	<?php wp_head(); ?>
    <title>喜鹊生活+</title>
    

   
 
    <script>
        $('document').ready(function(){
             $('#slider').unslider({
                speed: 500,
                delay: 3000,
                keys: true,
                dots: true,
                fluid: false,
                complete:function(){
                    $('.dot').each(function(index,element){
                        if($(this).hasClass('active')) {
                            $('.circle-white').removeClass('circle-white');
                            $('.circle-'+(index +1)).addClass('circle-white');
                        }
                    })
                }
            });
        })
    </script>
</head>
<body>
    <!--文章slider-->
	<div class="xq-content-big">
		<?php do_action( 'xique_set_slider' ); ?>
	</div>
    <!--文章slider end-->
	<!--文章分类-->
    <?php
    $category_ids = get_all_category_ids();
    if (count($category_ids)  > 1  and count($category_ids) < 6) :        
    ?>
    <nav>
	  <?php
        foreach($category_ids as $cat_id) {
            $category_name = get_cat_name($cat_id);
			      $category_link = get_category_link( $cat_id );
		?>
        <span><a href="<?php echo esc_url( $category_link ); ?>" title="Category Name"><?php echo  $category_name ?> </a></span>
     <?php 
     } 
     ?>   
    </nav>
    <?php endif; ?>
	 <!--文章分类 end-->
    <!--文章列表-->
    <?php while( have_posts() ) : the_post();?>
    <div class="xq-content block">
       
        <?php if ( has_post_thumbnail() ) : /*check for thumbnail existing*/ ?>
			  <a class="xique-content-headertitle"  href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
			  
		<?php { the_post_thumbnail(get_the_ID(), 'small', true);  } 
			  else :?>
  
   			 <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
					<img src="<?php echo site_url();?>/wp-content/themes/xique/images/thumbnail.png"/>
					</a>
          
		</a>	  <?php endif;?>
		<div>
            <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title_cut() ?></a></h2>
            <div><span>From</span><span><?php the_author(); ?></span></div>
        </div>
    </div>
    <?php endwhile;?>
    <!--文章list end-->
	<div class="xq-content block" id="more_articles" style="text-align: center;"><h2><a href="javascript:getMoreArticle();" >获取更多...</a></h2></div>
</body>
</html>
<?php
}
?>